//package com.qfdu.repo.dao.impl;
//
//import com.qfdu.repo.bean.Manager;
//import com.qfdu.repo.dao.ManagerDao;
//import com.qfdu.repo.db.DBUtils;
//import com.qfdu.repo.db.PstCallback;
//
//import java.sql.PreparedStatement;
//import java.sql.ResultSet;
//import java.sql.SQLException;
//
///**
// * @author 沐辰
// * @version v1.0
// * @description:
// * @project Qfed2401
// * @Date 2024/5/8 16:09
// * @company qf
// */
//public class ManagerDaoImpl implements ManagerDao {
//    public Manager login(final String username, final String password) {
//password        String sql = "select * from manager where account = ? and password = ?";
//        Manager manager = null;
//        ResultSet resultSet = DBUtils.query(sql, new PstCallback() {
//            public void pstSetValue(PreparedStatement pst) {
//                try {
//                    pst.setString(1,username);
//                    pst.setString(2,password);
//                } catch (SQLException e) {
//                    throw new RuntimeException(e);
//                }
//            }
//        });
//        try {
//            while (resultSet.next()) {
//                int id = resultSet.getInt("id");
//                String account = resultSet.getString("account");
//                String pwd = resultSet.getString("password");
//                String phone = resultSet.getString("phone");
//                String level = resultSet.getString("level");
//                String remark = resultSet.getString("remark");
//                manager = new Manager(id,account,pwd,phone,level,remark);
//            }
//        } catch (SQLException e) {
//            throw new RuntimeException(e);
//        } finally {
//            try {
//                resultSet.close();
//                DBUtils.getClose();
//            } catch (SQLException e) {
//                throw new RuntimeException(e);
//            }
//        }
//        return manager;
//    }
//}
